<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>请回答问题</title>
	<link rel="stylesheet" href="__ADMINJS__/plugins/elementui/element-ui/lib/theme-chalk/index.css">
	<script src="__ADMINJS__/jquery.min.js?v=2.1.4"></script>
	<script src="__ADMINJS__/plugins/elementui/vue/vue.js"></script>
	<script src="__ADMINJS__/plugins/elementui/element-ui/lib/index.js"></script>
	<script src="__JS__/bg.js"></script>
	<style media="screen">
		* {
			margin: 0;padding: 0;
		}
		body{
			width: 100%;height: 100%;
			overflow: hidden;
		}
	</style>
</head>
<body>
<!--[if lt IE 9]><div class="isIE"><p><b>浏览器版本过低</b><br>请使用IE9以上或chrome、firefox、safari等最新版浏览器！</p></div><![endif]-->

<div id="main">
	<el-dialog :modal="false" width="395px"
		:close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
		title="请问我的姓名是？" :visible.sync="is_show_name">
		<el-input v-model="form.name" placeholder="请输入拼音全拼"></el-input>
		<div slot="footer" class="dialog-footer">
			<el-button type="info" plain @click="goBack">返回</el-button>
			<el-button type="warning" plain @click="changeQuestion">不知道换一题</el-button>
			<el-button type="primary" plain @click="subForm">确定</el-button>
		</div>
	</el-dialog>
	<el-dialog :modal="false" width="395px"
		:close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
		title="请问我的手机号是？" :visible.sync="is_show_phone">
		<el-input v-model="form.phone" placeholder="请输入手机号"></el-input>
		<div slot="footer" class="dialog-footer">
			<el-button type="info" plain @click="goBack">返回</el-button>
			<el-button type="warning" plain @click="changeQuestion">不知道换一题</el-button>
			<el-button type="primary" plain @click="subForm">确定</el-button>
		</div>
	</el-dialog>
</div>
<canvas id="background"></canvas>
<script type="text/javascript">
var main = new Vue({
	el:"#main",
	data:{
		is_show_name:true,
		is_show_phone:false,
		tips:"请填写我的手机号或姓名的全拼",
		form:{
			name:"",
			phone:"",
		}
	},
	methods:{
		subForm() {
			if(this.form.name == '' && this.form.phone == ''){
				this.$notify.error({title:"错误",message:"请填写"})
				return false;
			}
			var param = this.form;
			var url = '{:url("index/index/resume")}';
			$.post(url,param,function(res){
				if(res.code != 1){
					main.$notify.error({title:"错误",message:res.msg})
				}else{
					var url = "/" + res.data;
					window.location.href = url;
				}
			});
		},
		changeQuestion() {
			if(this.is_show_name){
				this.is_show_name = false;
				this.is_show_phone = true;
			}else{
				this.is_show_name = true;
				this.is_show_phone = false;
			}
		},
		goBack() {
			window.location.href = "{:url('index/index')}";
		}
	}
});
</script>
</body>
</html>
